package app

import (
	"gin-api-server/app/server/mis"
	"gin-api-server/app/server/upload"
	"gin-api-server/app/server/wechat"
	"github.com/gin-gonic/gin"
)

type Routes struct {
	Method  string                 `json:"method"`
	Url     string                 `json:"url"`
	Handler func(ctx *gin.Context) `json:"handler"`
}

// ApiRoutes 注册接口路由
func ApiRoutes() map[string][]Routes {

	return map[string][]Routes{
		"mis": {
			{"get", "/dbconfig", mis.GetDbConfigDataServer},
			{"post", "/upload", upload.Action},
		},
		"upload": {
			{"post", "/action", upload.Action},
		},
		"wechat": {
			{"get", "/getminiappopenid", wechat.GetMiniappOpenidServer},
			{"get", "/exchangeminiappmobile", wechat.ExchangeMiniappMobileServer},
			{"post", "/getminiappqr", wechat.GetMiniappQrServer},
		},
	}

}

// BackendRoutes 注册后台路由
func BackendRoutes() map[string][]Routes {

	return map[string][]Routes{}
}

// ViewRoutes 注册前台路由
func ViewRoutes() map[string][]Routes {

	return map[string][]Routes{}
}
